import { Login, Home, Cart, NotFound, MyRedux } from '../pages'
import { BasicLayout, BlankLayout } from '../layouts'

const routes = [
  {
    path: '/',
    element: <BlankLayout />,
    children: [
      {
        // path: 'login',
        index: true, //在嵌套路由中，如果URL仅匹配了父级URL，则Outlet中会显示带有index属性的路由
        // index 首页，为true，默认为展示的首页，有index。就不会有path
        element: <Login />,
      },
      {
        path: 'redux',
        element: <MyRedux />,
      },
    ],
  },
  {
    path: '/basic',
    element: <BasicLayout />,
    children: [
      {
        path: 'home',
        element: <Home />,
      },
      {
        path: 'cart',
        element: <Cart />,
      },
    ],
  },
  {
    path: '*',
    element: <NotFound />,
  },
]

export default routes
